#ifndef RENDERER_H
#define RENDERER_H

// include the basic windows header files and the Direct3D header file
#include <windows.h>
#include <windowsx.h>
#include <d3d9.h>
#include <d3dx9.h>

// define the screen resolution
#define SCREEN_WIDTH 800
#define SCREEN_HEIGHT 600

// include the Direct3D Library files
#pragma comment (lib, "d3d9.lib")
#pragma comment (lib, "d3dx9.lib")

class Renderer
{
private:
	//these may need to be made public in other projects, but it works fine with this demonstration
	LPDIRECT3D9 d3d;    // the pointer to our Direct3D interface
	LPDIRECT3DDEVICE9 d3ddev;    // the pointer to the device class
	LPDIRECT3DVERTEXBUFFER9 v_buffer;    // the pointer to the vertex buffer
public:

	//constructor and deconstructor prototypes
	//constructor first sets v_buffer to NULL first because it is needed in initD3D
	//This makes it so once an object of Renderer is created, initD3D is created, and within initD3D is where init_graphics() is called
		//so there is no need to call that
	Renderer(HWND hWnd) { v_buffer = NULL; initD3D(hWnd); }
	~Renderer() { cleanD3D(); } 	//calls cleanD3D() in the destructor
	// function prototypes
	void initD3D(HWND hWnd);    // sets up and initializes Direct3D
	void render_frame();    // renders a single frame
	void cleanD3D(void);    // closes Direct3D and releases memory
	void init_graphics(void);    // 3D declarations

	//struct that holds a vertex, later we instantiate an array to hold all the vertices needed
	struct CUSTOMVERTEX {FLOAT X, Y, Z; DWORD COLOR;};
	#define CUSTOMFVF (D3DFVF_XYZ | D3DFVF_DIFFUSE)

};

#endif